﻿<%@ Page Language="C#" MasterPageFile="~/Admin/QuanLy.master" AutoEventWireup="true"
    CodeFile="QuanLyKhachHang.aspx.cs" Inherits="Admin_QuanLyKhachHang" Title="Quản lý khách hàng"
    Culture="auto" meta:resourcekey="PageResource1" UICulture="auto" Theme="Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .style1
        {
            text-align: right;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="content_t">
        &nbsp;</div>
    <div id="content">
        <div align="center" id="list">
            <h3>
                Danh sách khách hàng</h3>
            <asp:GridView SkinID="GridView" ID="gvKhachHang" runat="server" AutoGenerateColumns="False"
                OnPageIndexChanging="gvKhachHang_PageIndexChanging" OnRowCommand="gvKhachHang_RowCommand"
                OnRowDeleting="gvKhachHang_RowDeleting">
                <Columns>
                    <asp:BoundField DataField="TenKH" HeaderText="Tên khách hàng">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="CMND" HeaderText="CMND">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="DiaChi" HeaderText="Địa chỉ">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="SoDienThoai" HeaderText="Số điện thoại">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Email" HeaderText="Email">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="CapDo" HeaderText="Cấp độ">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:BoundField DataField="NgayDangKy" HeaderText="Ngày đăng ký">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:ButtonField CommandName="Sua" Text="Sửa" />
                    <asp:CommandField DeleteText="Xóa" ShowDeleteButton="True" />
                </Columns>
            </asp:GridView>
        </div>
        <div align="center" id="form">
            <asp:Table runat="server" ID="tblThemKH" Visible="False">
                <asp:TableRow>
                    <asp:TableCell>Nhập mã hóa đơn</asp:TableCell>
                    <asp:TableCell>
                        <asp:TextBox ID="txtMaHD" runat="server"></asp:TextBox></asp:TableCell>
                    <asp:TableCell>
                        <asp:Button ID="btnOK" runat="server" Text="Đồng ý"  OnClick="btnOK_Click" /></asp:TableCell>
                </asp:TableRow>
            </asp:Table>
            <asp:Table ID="tblSuaKH" SkinID="Table" runat="server" Visible="False">
                <asp:TableHeaderRow SkinID="TableHeaderRow">
                    <asp:TableHeaderCell ColumnSpan="2">
                        <asp:Label ID="lbNhap" runat="server" Text="Nhập thông tin khách hàng"></asp:Label>
                    </asp:TableHeaderCell>
                </asp:TableHeaderRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell">
                        Tên khách hàng
                    </asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:TextBox CssClass="TextBox" ID="txtTen" runat="server" Width="200px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTen"
                            ErrorMessage="(*)"></asp:RequiredFieldValidator>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell">
                        CMND</asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:TextBox CssClass="TextBox" ID="txtCMND" runat="server" ReadOnly="True" Width="200px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtCMND"
                            ErrorMessage="(*)"></asp:RequiredFieldValidator>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell">
                       Địa chỉ
                    </asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:TextBox CssClass="TextBox" ID="txtDiaChi" runat="server" Width="200px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtDiaChi"
                            ErrorMessage="(*)"></asp:RequiredFieldValidator>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell">
                        Điện thoại
                    </asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:TextBox CssClass="TextBox" ID="txtDienThoai" runat="server" Width="200px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtDienThoai"
                            ErrorMessage="(*)"></asp:RequiredFieldValidator>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell">
                        Email
                    </asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:TextBox CssClass="TextBox" ID="txtEmail" runat="server" Width="200px"></asp:TextBox>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell">
                        Cấp độ
                    </asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:DropDownList CssClass="TextBox" ID="cmbCapDo" runat="server">
                        </asp:DropDownList>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableFooterRow SkinID="TableFooterRow">
                    <asp:TableHeaderCell ColumnSpan="2">
                        <asp:Button ID="btnCapNhat" runat="server" Text="Cập nhật" OnClick="btnCapNhat_Click" />
                        <asp:Button ID="btnHuy" runat="server" Text="Hủy bỏ" OnClick="btnHuy_Click" CausesValidation="False" />
                    </asp:TableHeaderCell>
                </asp:TableFooterRow>
            </asp:Table>
            
            <asp:Button ID="btnThemKH" runat="server" Text="Thêm khách hàng" OnClick="btnThemKH_Click"
                CausesValidation="False" meta:resourcekey="btnThemKHResource1" />
        </div>
    </div>
    <div id="content_b">
        &nbsp;</div>
</asp:Content>
